package net.atomtree.entity.init;

import net.atomtree.corrsepond.analyse.SpiderAnalyse;
import net.atomtree.corrsepond.spider.SpiderContext;
import net.atomtree.corrsepond.spider.service.RunningApplicationService;
import net.atomtree.entity.Application;

import java.util.Properties;

/**
 * Created by czk on 2016/1/4.
 */
public class ApplicationInit {
    public Application app=new Application();
    public Application init(String appId) throws Exception {
//        String currHost= new Properties().getProperty("currHost");
        String currHost="101.204.243.107";
        String currPort=new RunningApplicationService().getPort(appId);
//        String currAppName=new RunningApplicationService().getAppName(appId);
        String currAppName=null;
        if (null!=currAppName)
            this.app.appName=currAppName;
        if(null!=currPort)
            this.app.port=currPort;
        if (null!=currHost)
            this.app.host=currHost;
        return app;
    }
}